import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XhljDiscussionLikeForm, XhljDiscussionLikeQuery, XhljDiscussionLikeVo } from '@/api/xhlj/model/discussionLikeModel';
import { request } from '@/utils/request';

// 查询讨论点赞列表
export function listDiscussionLike(query?: XhljDiscussionLikeQuery) {
  return request.get<TableDataInfo<XhljDiscussionLikeVo>>({
    url: '/xhlj/discussionLike/list',
    params: query,
  });
}

// 查询讨论点赞详细
export function getDiscussionLike(discussionLikeId: number) {
  return request.get<R<XhljDiscussionLikeVo>>({
    url: `/xhlj/discussionLike/${discussionLikeId}`,
  });
}

// 新增讨论点赞
export function addDiscussionLike(data: XhljDiscussionLikeForm) {
  return request.post<R<void>>({
    url: '/xhlj/discussionLike',
    data,
  });
}

// 修改讨论点赞
export function updateDiscussionLike(data: XhljDiscussionLikeForm) {
  return request.put<R<void>>({
    url: '/xhlj/discussionLike',
    data,
  });
}

// 删除讨论点赞
export function delDiscussionLike(discussionLikeIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xhlj/discussionLike/${discussionLikeIds}`,
  });
}
